<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.9.1.min.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script>
        $(function(){
            $("#getinfo").click(function(){
                let token = $.cookie("token");
                alert(token);
                $.ajax({
                    type:"post",
                    url:"/admin/getinfo",
                    dataType:"json",
                    headers:{"Authentication":token},
                    success:function(json){
                        if(json.state == 2000){
                            alert("okkkkkk");
                            $("#username").html(json.data.username)
                            $("#nickname").html(json.data.nickname)
                            $("#phone").html(json.data.phone)
                            $("#email").html(json.data.email)
                            $("#description").html(json.data.description)
                        }else{
                            alert(json.message)
                        }
                    }
                });
            });
        });
    </script>
</head>
<body>
    <button id="getinfo">获取当前登录用户信息</button>
    <p>
        username: <span id="username" ></span>
    </p>
    <p>
        nickname: <span id="nickname" ></span>
    </p>
    <p>
        phone: <span id="phone" ></span>
    </p>
    <p>
        email: <span id="email" ></span>
    </p>
    <p>
        description: <span id="description" ></span>
    </p>
</body>
</html>